package firebase;

import com.firebase.client.Firebase;
import com.firebase.client.OnDisconnect;

public class DupHelper {
	


	public static void main(String[] args) {
		Firebase sourceRef = new Firebase("https://luntankong.firebaseIO.com/runtime/post/source/needload");
		Firebase bkRef = sourceRef.getParent().child("bk");
		sync(bkRef,sourceRef);
		
		
//		sourceRef.onDisconnect().cancel();
//		bkRef.onDisconnect().cancel();
//		sync(sourceRef,bkRef);
	}


	private static void sync(Firebase from,Firebase to) {
		DupHelperListener listener = new DupHelperListener(to);
		from.addChildEventListener(listener);
//		from.removeEventListener(listener);
	}

}
